<!doctype html>

<!--
 Copyright 2012 Google Inc. All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<html>
<head>
    <title>Street Identity AP Client Demo Application</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
</head>

<body>

<p>Hello {{email}}</p>
{% if not street_address or not phone or not dob %}
<form id="add_attribute" action="/account/add" method="post">

    Type of attribute:
    <select name="type">
        {% if not street_address %}<option value="street_address">Street Address</option>{% endif %}
        {% if not phone %}<option value="phone_number">Phone Number</option>{% endif %}
        {% if not dob %}<option value="birthday">Birthday</option>{% endif %}
    </select>
    <br />
    Value (Address/Phone number/...): <input type="text" name="value"><br />
    Description: <input type="text" name="desc"><br />
    <input type="reset" value="Reset" class="button">
    <input type="submit" value="Submit" class="button"><br />

</form>
{% endif %}

<p>Your verified attributes:</p>

<ul>
    {% if street_address %}
    <li>{{ street_address.desc }} - {{ street_address.value }} - {{ street_address.type }}
        {% ifequal street_address.si_id '' %}
        <form action="/streetidentity/save" method="post">
            <input type="hidden" name="id" value="{{ street_address.id }}">
            <input type="submit" value="Save to Google" class="button">
        </form>
        {% else %}
        <form action="/streetidentity/remove" method="post">
            <input type="hidden" name="id" value="{{ street_address.id }}">
            <input type="submit" value="Remove from Google" class="button">
        </form>
        {% endifequal %}
    </li>
    {% endif %}
    {% if phone %}
    <li>{{ phone.desc }} - {{ phone.value }} - {{ phone.type }}
        {% ifequal phone.si_id '' %}
        <form action="/streetidentity/save" method="post">
            <input type="hidden" name="id" value="{{ phone.id }}">
            <input type="submit" value="Save to Google" class="button">
        </form>
        {% else %}
        <form action="/streetidentity/remove" method="post">
            <input type="hidden" name="id" value="{{ phone.id }}">
            <input type="submit" value="Remove from Google" class="button">
        </form>
        {% endifequal %}
    </li>
    {% endif %}
    {% if dob %}
    <li>{{ dob.desc }} - {{ dob.value }} - {{ dob.type }}
        {% ifequal dob.si_id '' %}
        <form action="/streetidentity/save" method="post">
            <input type="hidden" name="id" value="{{ dob.id }}">
            <input type="submit" value="Save to Google" class="button">
        </form>
        {% else %}
        <form action="/streetidentity/remove" method="post">
            <input type="hidden" name="id" value="{{ dob.id }}">
            <input type="submit" value="Remove from Google" class="button">
        </form>
        {% endifequal %}
    </li>
    {% endif %}
</ul>
<p>
    <a href="/sign_out">Sign Out</a>
</p>

</body>
</html>